home *** CD-ROM | disk | FTP | other *** search
/ MacFormat 1995 January / macformat-020.iso / Shareware City / Developers / URL Helper II / Source / URLHelperComponentPrivate.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-08-14  |  6.6 KB  |  220 lines  |  [TEXT/MMCC]

  1. /***
  2.  * URLHelperComponentPrivate.h
  3.  *
  4.  *  Header file for private URLHelper component stuff -- things that only debugging routines
  5.  *  and the URLHelper component itself will need to include
  6.  *
  7.  ***/
  8.  
  9. #pragma once
  10. #include "URLHelperComponent.h"
  11. #include "MemoryBuffer.h"
  12.  
  13. /**
  14.  ** The global storage for this component
  15.  **/
  16.  
  17. typedef struct URLHMirror  URLHMirror, *URLHMirrorPtr, **URLHMirrorHandle;
  18.  
  19. struct URLHMirror{
  20.     URLHMirrorPtr    next;                    // Linked list!
  21.  
  22.     short            oName;                    // Name of this mirror
  23.     URLHMirrorFlags    mirrorFlags;            // Usage flags
  24.     
  25. };
  26.  
  27.  
  28. typedef struct URLHMirrorList URLHMirrorList, 
  29.         *URLHMirrorListPtr, **URLHMirrorListHandle;
  30.  
  31. struct URLHMirrorList {
  32.     Handle                stringBuffer;        // strings for our use!
  33.     URLHMirrorListPtr    next;                // Next dude in the list of mirror lists
  34.     URLHMirrorPtr        firstMirror;        // First mirror in the list
  35.  
  36.     short        oName;                        // Name of the mirror list
  37.  
  38.     long        listStatus;                    // Flags for the list
  39.  
  40. };
  41.  
  42. typedef struct {
  43.     ComponentInstance    self;
  44.     URLHMirrorListPtr    mirrorList;
  45. } URLGlobals, *URLGlobalsPtr, **URLGlobalsHandle;
  46.  
  47. typedef struct URLHParseState *URLHParseStatePtr, **URLHParseStateHandle;
  48.  
  49. /**
  50.  ** Status flags
  51.  **/
  52.  
  53. #define kMLModified        0x01
  54.  
  55. /**
  56.  ** The revision level of this component
  57.  **/
  58.  
  59. enum {
  60.     URLHelperInterfaceRevision = 0x00010001
  61. };
  62.  
  63. /**
  64.  ** If we are running in debug mode, then we should define the dispatch routine.
  65.  **/
  66.  
  67. #ifdef DEBUG_IT
  68.     pascal ComponentResult URLHelperDispatcher (ComponentParameters    *params,
  69.                                             Handle                storage);
  70. #endif
  71.  
  72. /**
  73.  ** Protos for the routines that do the real work
  74.  **/
  75.  
  76. pascal    ComponentResult    _URLHelperOpen        (Handle                    storage,
  77.                                          ComponentInstance        self);
  78. enum {
  79.     uupURLOpen = kPascalStackBased
  80.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  81.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  82.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ComponentInstance)))
  83. };
  84.  
  85. pascal    ComponentResult    _URLHelperClose        (Handle                    storage,
  86.                                          ComponentInstance        self);
  87. enum {
  88.     uupURLClose = kPascalStackBased
  89.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  90.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  91.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ComponentInstance)))
  92. };
  93.  
  94. pascal    ComponentResult    _URLHelperCanDo        (short                    selector);
  95. enum {
  96.     uupURLCanDo = kPascalStackBased
  97.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  98.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(short)))
  99. };
  100.  
  101. pascal    ComponentResult    _URLHelperVersion    (void);
  102. enum {
  103.     uupURLVersion = kPascalStackBased
  104.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  105. };
  106.  
  107. pascal    ComponentResult    _URLHelperTarget        (Handle                    storage,
  108.                                          ComponentInstance        capturingComponent);
  109. enum {
  110.     uupURLTarget = kPascalStackBased
  111.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  112.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  113.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(ComponentInstance)))
  114. };
  115.  
  116. /**
  117.  ** Our own routines
  118.  **/
  119.  
  120. pascal ComponentResult _URLHelperGetMirrorList (Handle storage,
  121.                                         StringPtr            string,
  122.                                         URLHMirrorListPtr    *ref);
  123. enum {
  124.     uupURLHelperGetMirrorList = kPascalStackBased
  125.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  126.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  127.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(StringPtr)))
  128.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(URLHMirrorListPtr)))
  129. };
  130.  
  131. pascal ComponentResult _URLHelperNewMirrorList (Handle storage,
  132.                                         StringPtr            string,
  133.                                         URLHMirrorListPtr    *ref);
  134. enum {
  135.     uupURLHelperNewMirrorList = kPascalStackBased
  136.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  137.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  138.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(StringPtr)))
  139.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(URLHMirrorListPtr)))
  140. };
  141.  
  142. pascal ComponentResult _URLHelperAddMirror (Handle storage,
  143.                                         URLHMirrorListPtr    ref,
  144.                                         StringPtr            mirrorName,
  145.                                         URLHMirrorFlags        flags);
  146. enum {
  147.     uupURLHelperAddMirror = kPascalStackBased
  148.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  149.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  150.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(URLHMirrorListPtr)))
  151.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(StringPtr)))
  152.         | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(URLHMirrorFlags)))
  153. };
  154.  
  155. pascal ComponentResult _URLHelperNumberOfMirrors (Handle storage,
  156.                                         URLHMirrorListPtr    ref,
  157.                                         short                *num);
  158. enum {
  159.     uupURLHelperNumberOfMirrors = kPascalStackBased
  160.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  161.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  162.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(URLHMirrorListPtr)))
  163.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short *)))
  164. };
  165.  
  166. pascal ComponentResult _URLHelperGetUsableMirror (Handle storage,
  167.                                         URLHMirrorListPtr    mirrorListRef,
  168.                                         URLHMirrorPtr        *mirrorRef,
  169.                                         short                index);
  170. enum {
  171.     uupURLHelperGetUsableMirror = kPascalStackBased
  172.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  173.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  174.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(URLHMirrorListPtr)))
  175.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(URLHMirrorPtr *)))
  176.         | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  177. };
  178.  
  179. pascal ComponentResult _URLHelperNewParseState (Handle storage,
  180.                                         StringPtr            aURL,
  181.                                         URLHParseStatePtr    *pState);
  182. enum {
  183.     uupURLHelperNewParseState = kPascalStackBased
  184.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  185.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  186.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(StringPtr)))
  187.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(URLHParseStatePtr *)))
  188. };
  189.  
  190. pascal ComponentResult _URLHelperDisposeParseState (Handle storage,
  191.                                         URLHParseStatePtr    pState);
  192. enum {
  193.     uupURLHelperDisposeParseState = kPascalStackBased
  194.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  195.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  196.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(URLHParseStatePtr)))
  197. };
  198.  
  199. pascal ComponentResult _URLHelperGetMirrorRep (Handle storage,
  200.                                         URLHParseStatePtr    pState,
  201.                                         StringPtr            newURL,
  202.                                         short                index);
  203. enum {
  204.     uupURLHelperGetMirrorRep = kPascalStackBased
  205.         | RESULT_SIZE(SIZE_CODE(sizeof(ComponentResult)))
  206.         | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(Handle)))
  207.         | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(URLHParseStatePtr)))
  208.         | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(StringPtr)))
  209.         | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  210. };
  211.  
  212. /**
  213.  ** A little something to help out with our life
  214.  **/
  215. #define genericError    -1L
  216.  
  217. /**
  218.  ** Utility routines that we use
  219.  **/
  220.